package com.nf.action;

import com.nf.service.TestService;
import com.nf.service.TestServiceIml;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class Test1 {

    @Autowired
    private TestService testServiceIml;

    @RequestMapping("/test1")
    public String zz(@RequestParam(value = "currentPage",defaultValue = "1")int currentPage,Model model){
        System.out.println("当前页数："+currentPage);
        System.out.println(testServiceIml.getSelectPageCourse(currentPage));

        model.addAttribute("currentPage",currentPage);
        model.addAttribute("countRow",testServiceIml.getCountRow());
        model.addAttribute("pageSize",testServiceIml.getPageSize());
        model.addAttribute("courseList",testServiceIml.getSelectPageCourse(currentPage));

        return "show2";
    }
}
